﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Super_Wall_Breaker.Sources.GameElements
{
    /// <summary>
    /// The Sound of the game
    /// </summary>
    public class Sound
    {
        static Sound instance = null;        

        private SoundEffect _applause;
        private SoundEffect _explosion;
        private SoundEffect _audio_out;
        private SoundEffect _laser;        
        private Song _audio_Never_Gonna_Give_You_Up;
        private Song _audio_Menu;              

        private Sound() { }

        /// <summary>
        /// Gets the SoundSingleton.
        /// </summary>
        public static Sound GetInstance 
        {
            get
            {
                if (instance == null)
                    instance = new Sound();

                return instance;
            }
        }

        /// <summary>
        /// Gets or sets the applause.
        /// </summary>
        /// <value>
        /// The applause.
        /// </value>
        public SoundEffect Applause
        {
            get { return _applause; }
            set { _applause = value; }
        }

        /// <summary>
        /// Gets or sets the explosion.
        /// </summary>
        /// <value>
        /// The explosion.
        /// </value>
        public SoundEffect Explosion
        {
            get { return _explosion; }
            set { _explosion = value; }
        }

        /// <summary>
        /// Gets or sets the audio_out.
        /// </summary>
        /// <value>
        /// The audio_out.
        /// </value>
        public SoundEffect Audio_out
        {
            get { return _audio_out; }
            set { _audio_out = value; }
        }

        /// <summary>
        /// Gets or sets the laser.
        /// </summary>
        /// <value>
        /// The laser.
        /// </value>
        public SoundEffect Laser
        {
            get { return _laser; }
            set { _laser = value; }
        }

        /// <summary>
        /// Gets or sets the audio_ never_ gonna_ give_ you_ up.
        /// </summary>
        /// <value>
        /// The audio_ never_ gonna_ give_ you_ up.
        /// </value>
        public Song Audio_Never_Gonna_Give_You_Up
        { 
            get { return this._audio_Never_Gonna_Give_You_Up; }
            set { this._audio_Never_Gonna_Give_You_Up = value; }
        }

        /// <summary>
        /// Gets or sets the audio menu.
        /// </summary>
        /// <value>
        /// The audio menu.
        /// </value>
        public Song AudioMenu
        {
            get { return _audio_Menu; }
            set { _audio_Menu = value; }
        }

        /// <summary>
        /// Loads the contentSound.
        /// </summary>
        /// <param name="content">The content.</param>
        public void LoadContent(ContentManager content)
        {
            _applause = content.Load<SoundEffect>("audio_applause");
            _explosion = content.Load<SoundEffect>("audio_explosion");
            _audio_out = content.Load<SoundEffect>("audio_out");
            _laser = content.Load<SoundEffect>("audio_laser");
            _audio_Never_Gonna_Give_You_Up = content.Load<Song>("audio_NeverGonnaGiveYouUp");
            _audio_Menu = content.Load<Song>("audio_menu");
        }
    }
}
